#include "Shm.hpp"
#include "Fifo.hpp"

int main()
{
    // 创建共享内存
    Shm shm(PATHNAME, PROJID, CREATOR);
    char *mem = (char *)shm.VirtualAddr();

    // 创建命名管道
    NamedFifo fifo(CURRENTPATH, FILENAME);
    fifo.Create();

    // 文件操作
    FileOper readFile(CURRENTPATH, FILENAME);
    readFile.OpenForRead();
    while (true)
    {
        if (readFile.Wait())
        {
            printf("mem: %s\n", mem);
        }
        else
            break;
    }
    shm.Attr();

    return 0;
}